#include "NumTOStr.h"

float StrtoNum_4digit(unsigned char Str_NumGroup[],int Start_Position)
{
    int OCTOutput;

    int Str_Input0=Str_NumGroup[Start_Position];
    int Str_Input1=Str_NumGroup[Start_Position+1];

    OCTOutput=Str_Input0*100+Str_Input1;
    if(OCTOutput>9999)
    {
        OCTOutput=6666;//纯粹是为了方便进行错误判别
    }
    return OCTOutput;
}

void NumtoStr_4digit(int OCT_Num,unsigned char Str_NumGroup[],int Start_Position) 
{
    unsigned char High_Input,Lo_Input;
    unsigned char *BCD_Output0=&Str_NumGroup[Start_Position];
    unsigned char *BCD_Output1=&Str_NumGroup[Start_Position+1];
    if(OCT_Num>9999)
    {
        OCT_Num=6666;
    }
    
    High_Input=OCT_Num/100;
    Lo_Input=OCT_Num%100;
    
    *BCD_Output0=High_Input;
    *BCD_Output1=Lo_Input;
    
}
